package com.itheima.二维数组;

public class Demo02 {
    public static void main(String[] args) {
        int [][] arr = {{10,20,30},{22,19,5,31}};
        int max = arr[0][0];
        for (int i = 0; i < arr.length; i++) {
            System.out.print("[");
            for (int j = 0; j < arr[i].length; j++) {
                if(j < arr[i].length - 1){
                    System.out.print(arr[i][j] + ", ");
                }else {
                    System.out.print(arr[i][j]);
                }
                if(max < arr[i][j]){
                    max = arr[i][j];
                }
            }
            System.out.println("]");
        }
        System.out.println("该二维数组内最大值为:" + max);
    }
}
